﻿using System.Data.Entity.ModelConfiguration;
using yiCommerce.Core.Domain.Brands;
using yiCommerce.Core.Domain.Tradings;

namespace yiCommerce.Data.Mapping.Tradings
{
    public class TradingOrderMapping : EntityTypeConfiguration<TradingOrder>
    {
        public TradingOrderMapping()
        {
            this.ToTable("Trading_Order_Mapping");
            this.HasKey(pm => pm.Id);

            this.HasRequired(pm => pm.Order)
                .WithMany()
                .HasForeignKey(pm => pm.OrderId);


            this.HasRequired(pm => pm.Trading)
                .WithMany()
                .HasForeignKey(pm => pm.TradingId);
        }
    }
}